package com.bawei.module_vip.ui

import android.util.Log
import com.bawei.lib_common.base.BaseResponse
import com.bawei.module_vip.data.VipItem
import com.bawei.module_vip.http.VipApi

import javax.inject.Inject
import com.bawei.module_vip.http.VipModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn

class VipRepository @Inject constructor(
    @VipModel.CommonMainApi
    private var vipApi: VipApi
){
   fun searchVipById(id:Long):Flow<VipItem> = flow {
       val response = vipApi.getVipById(id)
       emit(response)
   }.flowOn(Dispatchers.IO)
}